<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<img src="images/kitty.png" onclick="changePic();" id="demo" alt=""/>
<script>
    function changePic() {
        //alert("标签被点击了");
        //获取img标签 然后 控制他的src属性
        var demo = document.getElementById("demo");
        demo.src = "images/tiger.png";
    }
</script>
</body>
</html>